//通用类型

import 'package:json_annotation/json_annotation.dart';
part 'general_type.g.dart';

@JsonSerializable()
class GeneralType {
  @JsonKey(name: 'label') //label 是后端传来的数据,前端展示用name
  final String name;
  @JsonKey(name: 'value') //value 是后端传来的数据,前端展示用id
  final String id;

  GeneralType(this.name, this.id);

  factory GeneralType.fromJson(Map<String, dynamic> json) =>
      _$GeneralTypeFromJson(json);

  Map<String, dynamic> toJson(GeneralType instance) =>
      _$GeneralTypeToJson(this);
}
